package com.dragon.modules.yuegou.query.member;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.member.TemplateColumnEntity;
import com.dragon.modules.yuegou.enums.member.TemplateColumnIsDefault;
import com.dragon.modules.yuegou.enums.member.TemplateColumnType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 会员模板栏位信息 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2021-10-26 20:46:49
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class TemplateColumnQuery extends TemplateColumnEntity implements Query<TemplateColumnEntity> {

    /** 主键查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 模板设置id查询条件 */
	@JsonUnwrapped(prefix = "templateSetId")
	private Condition<String> templateSetIdCondition;

    /** code查询条件 */
	@JsonUnwrapped(prefix = "code")
	private Condition<String> codeCondition;

    /** 标题查询条件 */
	@JsonUnwrapped(prefix = "title")
	private Condition<String> titleCondition;

    /** 值查询条件 */
	@JsonUnwrapped(prefix = "value")
	private Condition<String> valueCondition;

    /** [枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<TemplateColumnType> typeCondition;

    /** [枚举]是否默认添加：0-否-NO、1-是-YES查询条件 */
	@JsonUnwrapped(prefix = "isDefault")
	private Condition<TemplateColumnIsDefault> isDefaultCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public TemplateColumnQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public TemplateColumnQuery(TemplateColumnEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public TemplateColumnQuery(TemplateColumnQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.templateSetIdCondition != null) {
			this.templateSetIdCondition = other.templateSetIdCondition.copy();
		}
		if(other.codeCondition != null) {
			this.codeCondition = other.codeCondition.copy();
		}
		if(other.titleCondition != null) {
			this.titleCondition = other.titleCondition.copy();
		}
		if(other.valueCondition != null) {
			this.valueCondition = other.valueCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		if(other.isDefaultCondition != null) {
			this.isDefaultCondition = other.isDefaultCondition.copy();
		}
	}

	@Override
	public QueryWrapper<TemplateColumnEntity> toQueryWrapper() {
		QueryWrapper<TemplateColumnEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (templateSetIdCondition != null) {
			templateSetIdCondition.toWrapper(wrapper, COL_TEMPLATE_SET_ID);
		}
		if (codeCondition != null) {
			codeCondition.toWrapper(wrapper, COL_CODE);
		}
		if (titleCondition != null) {
			titleCondition.toWrapper(wrapper, COL_TITLE);
		}
		if (valueCondition != null) {
			valueCondition.toWrapper(wrapper, COL_VALUE);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		if (isDefaultCondition != null) {
			isDefaultCondition.toWrapper(wrapper, COL_IS_DEFAULT);
		}
		return wrapper;
	}

	/**
	 * 构造并返回主键查询条件
	 * 
	 * @return idCondition 主键查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取主键查询条件
	 * 
	 * @return idCondition 主键查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置主键查询条件
	 * 
	 * @param idCondition 主键查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回模板设置id查询条件
	 * 
	 * @return templateSetIdCondition 模板设置id查询条件
	 */
	public Condition<String> templateSetId() {
		this.templateSetIdCondition = new Condition<>();
		return this.templateSetIdCondition;
	}
	
	/**
	 * 获取模板设置id查询条件
	 * 
	 * @return templateSetIdCondition 模板设置id查询条件
	 */
	public Condition<String> getTemplateSetIdCondition() {
		return templateSetIdCondition;
	}

	/**
	 * 设置模板设置id查询条件
	 * 
	 * @param templateSetIdCondition 模板设置id查询条件
	 */
	public void setTemplateSetIdCondition(Condition<String> templateSetIdCondition) {
		this.templateSetIdCondition = templateSetIdCondition;
	}

	/**
	 * 构造并返回code查询条件
	 * 
	 * @return codeCondition code查询条件
	 */
	public Condition<String> code() {
		this.codeCondition = new Condition<>();
		return this.codeCondition;
	}
	
	/**
	 * 获取code查询条件
	 * 
	 * @return codeCondition code查询条件
	 */
	public Condition<String> getCodeCondition() {
		return codeCondition;
	}

	/**
	 * 设置code查询条件
	 * 
	 * @param codeCondition code查询条件
	 */
	public void setCodeCondition(Condition<String> codeCondition) {
		this.codeCondition = codeCondition;
	}

	/**
	 * 构造并返回标题查询条件
	 * 
	 * @return titleCondition 标题查询条件
	 */
	public Condition<String> title() {
		this.titleCondition = new Condition<>();
		return this.titleCondition;
	}
	
	/**
	 * 获取标题查询条件
	 * 
	 * @return titleCondition 标题查询条件
	 */
	public Condition<String> getTitleCondition() {
		return titleCondition;
	}

	/**
	 * 设置标题查询条件
	 * 
	 * @param titleCondition 标题查询条件
	 */
	public void setTitleCondition(Condition<String> titleCondition) {
		this.titleCondition = titleCondition;
	}

	/**
	 * 构造并返回值查询条件
	 * 
	 * @return valueCondition 值查询条件
	 */
	public Condition<String> value() {
		this.valueCondition = new Condition<>();
		return this.valueCondition;
	}
	
	/**
	 * 获取值查询条件
	 * 
	 * @return valueCondition 值查询条件
	 */
	public Condition<String> getValueCondition() {
		return valueCondition;
	}

	/**
	 * 设置值查询条件
	 * 
	 * @param valueCondition 值查询条件
	 */
	public void setValueCondition(Condition<String> valueCondition) {
		this.valueCondition = valueCondition;
	}

	/**
	 * 构造并返回[枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件
	 * 
	 * @return typeCondition [枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件
	 */
	public Condition<TemplateColumnType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}
	
	/**
	 * 获取[枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件
	 * 
	 * @return typeCondition [枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件
	 */
	public Condition<TemplateColumnType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件
	 * 
	 * @param typeCondition [枚举]是否必填：0-电话-TEL、1-仅展示-NOTEL查询条件
	 */
	public void setTypeCondition(Condition<TemplateColumnType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回[枚举]是否默认添加：0-否-NO、1-是-YES查询条件
	 * 
	 * @return isDefaultCondition [枚举]是否默认添加：0-否-NO、1-是-YES查询条件
	 */
	public Condition<TemplateColumnIsDefault> isDefault() {
		this.isDefaultCondition = new Condition<>();
		return this.isDefaultCondition;
	}
	
	/**
	 * 获取[枚举]是否默认添加：0-否-NO、1-是-YES查询条件
	 * 
	 * @return isDefaultCondition [枚举]是否默认添加：0-否-NO、1-是-YES查询条件
	 */
	public Condition<TemplateColumnIsDefault> getIsDefaultCondition() {
		return isDefaultCondition;
	}

	/**
	 * 设置[枚举]是否默认添加：0-否-NO、1-是-YES查询条件
	 * 
	 * @param isDefaultCondition [枚举]是否默认添加：0-否-NO、1-是-YES查询条件
	 */
	public void setIsDefaultCondition(Condition<TemplateColumnIsDefault> isDefaultCondition) {
		this.isDefaultCondition = isDefaultCondition;
	}

}
